package command;

import java.util.HashMap;
import java.util.Map;

import impl_system.BadCommand;
import impl_system.SystemExitCommand;
import impl_system.SystemHelpCommand;
import impl_system.SystemLoginCommand;
import impl_system.SystemSignupCommand;

public class SystemCommandFactory extends CommandFactory {

	private static Map<CommandCode, Command> commandMap = new HashMap<>();

	static {
		commandMap.put(CommandCode.EXIT, new SystemExitCommand());
		commandMap.put(CommandCode.HELP, new SystemHelpCommand());
		commandMap.put(CommandCode.LOGIN, new SystemLoginCommand());
		commandMap.put(CommandCode.SIGNUP, new SystemSignupCommand());
		commandMap.put(CommandCode.ASK, new BadCommand());
		commandMap.put(CommandCode.ANSWER, new BadCommand());
		commandMap.put(CommandCode.LIST, new BadCommand());
		commandMap.put(CommandCode.ACCEPT, new BadCommand());
		commandMap.put(CommandCode.SCORE, new BadCommand());
		commandMap.put(CommandCode.QUIT, new BadCommand());
	}

	public Command buildCommand(CommandCode cmd) {
		Command comm = commandMap.get(cmd);
		return comm;
	}

}
